//
//  PushRentHouseHeader.m
//  Liuhe
//
//  Created by zr on 2018/8/14.
//  Copyright © 2018年 zr. All rights reserved.
//

#import "PushRentHouseHeader.h"
#import "PushInfoTableViewCell.h"
#import "InfoOthersTableViewCell.h"

@interface PushRentHouseHeader ()

@property(nonatomic, weak)UILabel * exploreLabel;
@property (nonatomic, weak)UIView * lineView;


@end

@implementation PushRentHouseHeader

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}


- (void)setupUI{
    
    self.backgroundColor = WHITE_COLOR;
    
    UIButton * addPictureButton = [UIButton new];
    
    [addPictureButton addTarget:self action:@selector(clikckAddPicture) forControlEvents:UIControlEventTouchUpInside];
    [addPictureButton setImage:ImageNamed(@"655654465") forState:UIControlStateNormal];
    
    self.addPictureButton = addPictureButton;
    
    [self addSubview:self.addPictureButton];
    
    
    UILabel * exploreLabel = [UILabel new];
    
    exploreLabel.text = @"可选择房屋客厅、厨房、卧室、卫生间等的照片";
    exploreLabel.textColor = ColorWithRGB(0xB3B3B3);
    exploreLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    exploreLabel.numberOfLines = 0;
    
    self.exploreLabel = exploreLabel;
    
    [self addSubview:self.exploreLabel];
    
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xe6e6e6);
    
    self.lineView = lineView;
    
    [self.contentView addSubview:self.lineView];
}


- (void)layoutSubviews{
    
    [self.addPictureButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(20 * SCREENH6);
        make.top.mas_equalTo(25 * SCREENH6);
        make.width.height.mas_equalTo(80 * SCREENH6);
    }];
    
    [self.exploreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.addPictureButton.mas_trailing).offset(10 * SCREENH6);
        make.trailing.mas_equalTo(self).offset(-35 * SCREENH6);
        make.top.mas_equalTo(self.addPictureButton).offset(25 * SCREENH6);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self.contentView);
        make.height.mas_equalTo(2 * SCREENH6);
        make.bottom.mas_equalTo(self);
    }];
}


- (void)clikckAddPicture{
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"addPictureToPushHouse" object:nil];
}

@end
